/*
 * @Author: your name
 * @Date: 2021-12-17 21:55:40
 * @LastEditTime: 2021-12-26 02:19:51
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \homeStayMS\src\main\resources\static\js\api\api.js
 */

// 由于导入工具的原因，js导入需要写成 require
const httpRequest = require("../utils/httpRequest.js");
const {
  post,
  get
} = httpRequest;

/**
 * 默认需要导出一个接口对象。 未来如果需要增加接口， 要在此处增加。
 * 接口添加规范：
 *
 * get请求：
 * 函数名： (p) => get(接口名,p)
 * registerUser: (p) => post('/register', p),
 *
 * post请求：
 * updateStoreInfo: (p) => post('/updateStore', p),
 *
 * 添加函数时需要默认写上注释，否则不清楚接口功能
 */
const api = {
  // 用户登录
  loginUser: (p) => post("/login", p),

  // 测试数据
  sessionTest: () => get("/session"),

  // 用户注册
  registerUser: (p) => post("/register", p),

  // 分页获取门店信息
  getStoreList: (p) => get("/getStoreList", p),
  // 获得全部的门店信息
  getAllStore: (p) => get("/getAllStore", p),
  // start 门店

  // 添加门店
  addStore: (p) => post("/addStore", p),

  // 修改门店信息
  updateStoreInfo: (p) => post("/updateStore", p),

  // 根据门店id查询门店信息
  getStoreInfoById: (p) => get("/getStoreBySid", p),

  // 移除门店信息
  removeStoreInfo: (p) => get("/deleteStore", p),

  // end 门店

  //获取全部的员工信息
  getEmpList: (p) => get("/getEmpList", p),

  addEmp: (p) => post("/addEmp", p),

  getEmpByEid: (p) => get("/getEmpByEid", p),

  updateEmp: (p) => post("/updateEmp", p),

  deleteEmp: (p) => get("/deleteEmp", p),

  countSalary: (p) => get("/countSalary", p),

  //获取全部的房客信息
  getTenantList: (p) => get("/getTenantList", p),

  addTenant: (p) => post("/addTenant", p),

  getTenantById: (p) => get("/getTenantById", p),

  updateTenant: (p) => post("/updateTenant", p),

  deleteTenant: (p) => get("/deleteTenant", p),

  //获取全部的房间信息
  getRoomList: (p) => get("/getRoomList", p),

  addRoom: (p) => post("/addRoom", p),

  getRoomByRid: (p) => get("/getRoomByRid", p),

  updateRoom: (p) => post("/updateRoom", p),

  deleteRoom: (p) => get("/deleteRoom", p),

  getRoomListByRnum: (p) => get("/getRoomListByRnum", p),

  getOrderInfoList: (p) => get("/getOrderInfoList", p),

  addOrder: (p) => post("/addOrder", p),

  getOrderById: (p) => get("/getOrderById", p),

  updateOrder: (p) => post("/updateOrder", p),

  deleteOrder: (p) => get("/deleteOrder", p),

  // 添加入住信息
  addRuzhuInfo: (p) => post('/ruzhu', p),

  //腾空房间
  tengkong: (p) => post('/tengkong', p),

  //计算收入
  getInCount: (p) => get("/getInCount", p),

};
// 集中导出一个接口对象。
module.exports = api;